<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="br.com.trabalho.entidades.Usuario"%>
<%@page import="br.com.trabalho.util.Util"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<c:if test="${sessionScope.USUARIO != null}">
    <jsp:useBean class="br.com.trabalho.entidades.Usuario" scope="session" id="USUARIO"></jsp:useBean>
</c:if>
<link href="css/default.css" rel="stylesheet">
    <header class="container">
        <div class="col-sm-7 col-md-7 col-lg-7 col-7">
            <a href="index"><img src="logo.png"/></a>
        </div>
        <div class="col-sm-2 col-md-2 col-lg-2 col-2">
            <form action="busca">
                <input type="text" class="form-control" name="chave" id="busca" placeholder="Buscar">
            </form>
        </div>
        <div class="col-sm-3 col-md-3 col-lg-3 col-3">
            <div id="menuUsuario">
                <c:if test="${USUARIO != null}">
                    <a href="index?logout=true">Logout: ${USUARIO.nome} </a><br>
                    <a href="cadastro">Editar Cadastro</a><br>
                    <c:if test="${USUARIO.permissao == 'ADMINISTRADOR'}">
                        <a href="admin">Administração do Portal</a><br>
                    </c:if>
                </c:if>
                <c:if test="${USUARIO == null}">
                    <a href="login.jsp">Login</a><br>
                </c:if>
                
            </div>
        </div>
    </header> 
    <nav class="navbar navbar-default" role="navigation">
        <div class="container">
          <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li><a href="index">Home</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <c:if test="${USUARIO != null}">
                    <li><a href="my_recipes">Minhas Receitas</a></li>
                    <li><a href="new_recipe">Cadastrar Nova Receita</a></li>
                </c:if>
            </ul>
          </div>
        </div>
    </nav>
